package com.lxb.store.service.Impl;

import com.lxb.store.dao.UserDao;
import com.lxb.store.entity.User;
import com.lxb.store.service.UserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

@Service
public class UserServiceImpl implements UserService{

    @Autowired
    private UserDao userDao;

    @Override
    public User add(User user) {
        return userDao.save(user);
    }

    @Override
    public User getByUsername(String username) {
        return userDao.getByUsername(username);
    }

    @Override
    public User update(User user) {
        return userDao.save(user);
    }

    @Override
    public User getById(Integer id) {
        return userDao.getById(id);
    }
}
